<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>

</body>
<script type="text/javascript">
var json = "{'a': 1}";
try {
	alert(eval(json));
} catch(err) {
	console.log(err);
}
alert(eval("(" + json + ")").a);

var f = function g() {
    return 1;
  };
  if (true) {
    f = function g(){
      return 2;
    };
  }
 alert(g()); // 2
</script>
</html>